<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
   <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<link rel='stylesheet' type='text/css' href='${initParam.root }/css/mentoring.css' />
<c:set value="${sessionScope.mvo }" var="mvo"></c:set>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script>
	$(function(){
		$("#questionTable tbody tr:even").click(function(){
			$(this).next().toggle();
		});
		$(".replyQuestion").click(function(){
			window.open("${initParam.root }/mentoring/replyView.do?no="+$(this).parents("tr").prev().children("td:first-child").text(), "popup",
			"width=600,height=500,top=50,left=400");
		});
	});
</script>
<div id="sendRequest">send</div>
<div id="questionStatus">

	<table cellpadding="3" width="100%" id="questionTable">
		<thead><tr valign="top">
			<th width="5%">Q.no</th>
			<th width="20%">STATUS</th>
			<th width="55%">QUESTION</th>
			<th width="20%">DATE</th>
			</tr></thead>
			<tbody valign="top">
			<c:forEach items="${requestScope.statusMap.qlist }" var="q">
				<tr>
					<td><b>
						<c:choose>
							<c:when test="${q.reNoteNo==-1 }">${q.refNo }	</c:when>
							<c:otherwise>${q.reNoteNo } </c:otherwise>
						</c:choose>
					</b></td>
					<td><b>${q.status }</b></td>
					<td><p class="contentText"><b>${q.content }</b></p></td>
					<td><b>${q.sendDate }</b></td>
				</tr>
				<tr style="display: none; " >					
					<td align="right" colspan="2"><b>▶
						<c:choose>
							<c:when test="${q.sender.id==mvo.id }">
								Question Level : ${q.level }							
							</c:when>
							<c:otherwise>
								Questioner Level : ${q.sender.level }
							</c:otherwise>
						</c:choose><br>
						<c:choose>
							<c:when test="${q.status=='보낸질문(대기중)'||q.status=='받은질문(대기중)' }">
								Reject : ${q.reject }
							</c:when>					
						</c:choose><br>
						<c:if test="${q.status=='받은질문(대기중)'}">
							<input type="button" value="답변" class="replyQuestion">
							<input type="button" value="거절">
						</c:if>
					</b></td>
					<td><pre>${q.content }</pre>
					
					</td>
					<td>
						<c:choose>
							<c:when test="${q.receiveDate==null }">Not Read</c:when>	
							<c:otherwise><b>ReceiveDate</b><br>${q.receiveDate}</c:otherwise>
						</c:choose>
					</td>
						
				</tr>
			</c:forEach>
			</tbody>
	</table>
	
</div>



<div id="receiveRequest">
receive


</div>
